/********************************************************************************
 * Copyright(c) 2020-2025 BST All rights reserved.
 * - Filename
 * - Author
 * - Version V1.0.0
 * - Date    2025/08/05
 * - Brief
 * - FunctionList:
 ******************************************************************************
 * History:
 *
 *
 *
 ******************************************************************************
 */

#pragma once
#include <functional>
#include <iostream>
#include <map>
#include <memory>
#include <thread>

#include "vzmq.hpp"
#include "FileReader.hpp"
#include "DhopReplayFrame.pb.h"

class ImageSender {
 public:
  ImageSender(void *context);
  ~ImageSender();
  void start(const std::string &path);
  void stop();

 private:
  bool _isExit{false};
  std::string _path;
  std::map<int, FileInfo> _fileList;
  std::shared_ptr<FileReader>_reader;
  vzmq::VzmqContext *_context{nullptr};
  std::shared_ptr<std::thread> _thread{nullptr};
  std::shared_ptr<vzmq::VzmqPublisher<ImageFrame>> _imgFameDispatch;
  void loop();
};
